import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/smart_warehouse/warehouse_device_curve_entity.dart';

WarehouseDeviceCurveEntity $WarehouseDeviceCurveEntityFromJson(Map<String, dynamic> json) {
  final WarehouseDeviceCurveEntity warehouseDeviceCurveEntity = WarehouseDeviceCurveEntity();
  final List<String>? x = (json['x'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (x != null) {
    warehouseDeviceCurveEntity.x = x;
  }
  final List<double>? humidityY = (json['humidityY'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<double>(e) as double).toList();
  if (humidityY != null) {
    warehouseDeviceCurveEntity.humidityY = humidityY;
  }
  final List<double>? temperatureY = (json['temperatureY'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<double>(e) as double).toList();
  if (temperatureY != null) {
    warehouseDeviceCurveEntity.temperatureY = temperatureY;
  }
  return warehouseDeviceCurveEntity;
}

Map<String, dynamic> $WarehouseDeviceCurveEntityToJson(WarehouseDeviceCurveEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['x'] = entity.x;
  data['humidityY'] = entity.humidityY;
  data['temperatureY'] = entity.temperatureY;
  return data;
}

extension WarehouseDeviceCurveEntityExtension on WarehouseDeviceCurveEntity {
  WarehouseDeviceCurveEntity copyWith({
    List<String>? x,
    List<double>? humidityY,
    List<double>? temperatureY,
  }) {
    return WarehouseDeviceCurveEntity()
      ..x = x ?? this.x
      ..humidityY = humidityY ?? this.humidityY
      ..temperatureY = temperatureY ?? this.temperatureY;
  }
}
